package group.sicher.common.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:07
 * @description
 */
@Entity
@Table(name = "wm_order_detail")
public class OrderDetailEntity {

    private Long id;
    private String orderCode;
    private String userUsername;
    private String userMobile;
    private Long userAddressId;
    private String userAddress;
    private String userLongitude;
    private String userLatitude;
    private String shopShopname;
    private String shopMobile;
    private String shopAddress;
    private String shopLongitude;
    private String shopLatitude;
    private Long deliverId;
    private String deliverName;
    private String deliverMobile;
    private String deliverDistance;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "order_code", nullable = false, length = 50)
    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    @Basic
    @Column(name = "user_username", nullable = true, length = 20)
    public String getUserUsername() {
        return userUsername;
    }

    public void setUserUsername(String userUsername) {
        this.userUsername = userUsername;
    }

    @Basic
    @Column(name = "user_mobile", nullable = true, length = 20)
    public String getUserMobile() {
        return userMobile;
    }

    public void setUserMobile(String userMobile) {
        this.userMobile = userMobile;
    }

    @Basic
    @Column(name = "user_address_id", nullable = true)
    public Long getUserAddressId() {
        return userAddressId;
    }

    public void setUserAddressId(Long userAddressId) {
        this.userAddressId = userAddressId;
    }

    @Basic
    @Column(name = "user_address", nullable = true, length = 500)
    public String getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    @Basic
    @Column(name = "user_longitude", nullable = true, length = 20)
    public String getUserLongitude() {
        return userLongitude;
    }

    public void setUserLongitude(String userLongitude) {
        this.userLongitude = userLongitude;
    }

    @Basic
    @Column(name = "user_latitude", nullable = true, length = 20)
    public String getUserLatitude() {
        return userLatitude;
    }

    public void setUserLatitude(String userLatitude) {
        this.userLatitude = userLatitude;
    }

    @Basic
    @Column(name = "shop_shopname", nullable = true, length = 20)
    public String getShopShopname() {
        return shopShopname;
    }

    public void setShopShopname(String shopShopname) {
        this.shopShopname = shopShopname;
    }

    @Basic
    @Column(name = "shop_mobile", nullable = true, length = 20)
    public String getShopMobile() {
        return shopMobile;
    }

    public void setShopMobile(String shopMobile) {
        this.shopMobile = shopMobile;
    }

    @Basic
    @Column(name = "shop_address", nullable = true, length = 500)
    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    @Basic
    @Column(name = "shop_longitude", nullable = true, length = 20)
    public String getShopLongitude() {
        return shopLongitude;
    }

    public void setShopLongitude(String shopLongitude) {
        this.shopLongitude = shopLongitude;
    }

    @Basic
    @Column(name = "shop_latitude", nullable = true, length = 20)
    public String getShopLatitude() {
        return shopLatitude;
    }

    public void setShopLatitude(String shopLatitude) {
        this.shopLatitude = shopLatitude;
    }

    @Basic
    @Column(name = "deliver_id", nullable = true)
    public Long getDeliverId() {
        return deliverId;
    }

    public void setDeliverId(Long deliverId) {
        this.deliverId = deliverId;
    }

    @Basic
    @Column(name = "deliver_name", nullable = true, length = 20)
    public String getDeliverName() {
        return deliverName;
    }

    public void setDeliverName(String deliverName) {
        this.deliverName = deliverName;
    }

    @Basic
    @Column(name = "deliver_mobile", nullable = true, length = 20)
    public String getDeliverMobile() {
        return deliverMobile;
    }

    public void setDeliverMobile(String deliverMobile) {
        this.deliverMobile = deliverMobile;
    }

    @Basic
    @Column(name = "deliver_distance", nullable = true, length = 60)
    public String getDeliverDistance() {
        return deliverDistance;
    }

    public void setDeliverDistance(String deliverDistance) {
        this.deliverDistance = deliverDistance;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderDetailEntity that = (OrderDetailEntity) o;
        return id == that.id &&
                Objects.equals(orderCode, that.orderCode) &&
                Objects.equals(userUsername, that.userUsername) &&
                Objects.equals(userMobile, that.userMobile) &&
                Objects.equals(userAddressId, that.userAddressId) &&
                Objects.equals(userAddress, that.userAddress) &&
                Objects.equals(userLongitude, that.userLongitude) &&
                Objects.equals(userLatitude, that.userLatitude) &&
                Objects.equals(shopShopname, that.shopShopname) &&
                Objects.equals(shopMobile, that.shopMobile) &&
                Objects.equals(shopAddress, that.shopAddress) &&
                Objects.equals(shopLongitude, that.shopLongitude) &&
                Objects.equals(shopLatitude, that.shopLatitude) &&
                Objects.equals(deliverId, that.deliverId) &&
                Objects.equals(deliverName, that.deliverName) &&
                Objects.equals(deliverMobile, that.deliverMobile) &&
                Objects.equals(deliverDistance, that.deliverDistance);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orderCode, userUsername, userMobile, userAddressId, userAddress, userLongitude, userLatitude, shopShopname, shopMobile, shopAddress, shopLongitude, shopLatitude, deliverId, deliverName, deliverMobile, deliverDistance);
    }
}
